<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}" scope="request"/>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="<c:url value='/resources/styles/main.css' />" type="text/css"/>
    <script type="text/javascript" src="<c:url value='/resources/scripts/datePicker/WdatePicker.js' />"></script>
    <script type="text/javascript">
        var contextPath = '${ctx}/';
        function deleteDate(id){

            if(window.confirm("确定要删除吗？"))
            {
                window.location.href=contextPath+'/admin/session/deleteSession.do?id='+id;
            }

            <%----%>
        }
    </script>
    <title>内容列表</title>
</head>
<body>
<table class="header">
    <tr>
        <td>
            <h1>会议内容列表</h1>
        </td>
    </tr>
</table>
<table class="pagination" style="padding-left: 70px;">
    <tr>
        <td>
            <a href="<c:url value="/admin/session/addSession.do" />">新建会议类容</a>
        </td>
        <td>
            <form method="post" action="<c:url value='/admin/session/listSession.do'/>" >
                会议时段:
                <select id="section" name="section">
                    <option value="" >--请选择--</option>
                    <option value="am" ${section=='am' ? 'selected' : ''}>上午</option>
                    <option value="noon" ${section=='noon' ? 'selected' : ''}>中午</option>
                    <option value="pm" ${section=='pm' ? 'selected': ''}>下午</option>
                    <option value="night" ${section=='night' ? 'selected': ''}>晚上</option>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </select>
                会议日期：&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" id="day" name="day" value="${day}"  class="Wdate" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd ', readOnly:true})"/>
                <input type="submit" value="搜索"/>
            </form>
        </td>
    </tr>
</table>

<table class="list">
    <tr>
        <th>序号</th>
        <th>标题(仅管理界面可见)</th>
        <th>会议时间</th>
        <th>会议时段</th>

        <th>分组名称A</th>
        <th>分组名称B</th>
        <th>会议地址</th>

        <th>删除</th>
    </tr>
    <c:choose>
        <c:when test="${totalCount > 0}">
            <c:forEach var="item" items="${results}">
                <tr>
                        <%--<td><input type="checkbox" class="itemId" value="${item.id}" /></td>--%>

                    <td><a href="<c:url value='/admin/session/viewSession.do?id=${item.id}'/>">${item.seq}</a></td>
                    <td>
                        <a href="<c:url value='/admin/session/viewSession.do?id=${item.id}'/>">${item.title}</a>
                    </td>

                            <td>
                                <fmt:formatDate value="${item.day}" pattern="yyyy-MM-dd"/>
                            </td>
                            <td>
                                   <c:if test="${item.section=='am'}">上午</c:if>
                                   <c:if test="${item.section=='noon'}">中午</c:if>
                                   <c:if test="${item.section=='pm'}">下午</c:if>
                                   <c:if test="${item.section=='night'}">晚上</c:if>
                            </td>


                    <td>
                            ${item.groupNameFirst}
                    </td>
                            <td>
                                    ${item.groupNameLast}
                            </td>
                            <td>
                                    ${item.hotelName}
                            </td>
                            <td>
                                <%--<a href="<c:url value='/admin/session/deleteSession.do?id=${item.id}'/>">删除</a>--%>
                                <a href="#" onclick="deleteDate('${item.id}')">删除</a>
                            </td>
                </tr>
            </c:forEach>
        </c:when>
        <c:otherwise>
            <tr>
                <td colspan="17">没有数据</td>
            </tr>
        </c:otherwise>
    </c:choose>

</table>
</body>
</html>